package com.cooperate.fly.service.buildDB;


import com.cooperate.fly.bo.Case;
import com.cooperate.fly.bo.TableWithBLOBs;
import com.cooperate.fly.web.Result;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;


/**
 * Created by Stellar_Lee on 2016/4/17.
 */
public interface BuildCaseService {

    Result createCaseNode(Case _case);

    Result deleteCaseNode(Case _case);

    Result deleteCaseNodeById(int id);

    Result updateCaseNode(Case _case);

    Result searchCaseNode(Case _case);

    Result searchCaseNodeById(int id);

    /**
     * 获得数据库所有case列表
     * @return
     */
    List<Case> getAllCases();

    String buildCaseFieldTree(int caseId);

    String getDataBaseCases(int dataBaseId);

    String getCatalogCases(int caseId);

    //visit interface

    String visitCases(String schemaNames);

    String visitCase(String schemaNames, String caseNames);

    String visitCaseById(int caseId);

    String visitField(String schemaNames, String caseNames, String fieldNames);

    String visitFields(String schemaNames, String caseNames, String fieldNames);

    //load excel to database
    boolean loadExcel(String filename, int caseId);

    //create special caseData dir
    void createSpecialDataDir(int caseId);

    //create .xls
    void createAndWriteExcel(int caseId);

    //update multi
    void updateMultiValue(int caseId, int fieldId, String value);

    //getImportCasesJson to update case tree
    String getImportTreeJson(int parentId);

    //for cases
    //create special caseData dir
    void createSpecialDataDirForCases(int parentId);

    //create .xls
    void createAndWriteExcelForCases(int parentId);

    //when do with linkData, build case tree, checkbox on caseNode to choose
    String getAllCasesToChoose(String checkIds, HttpSession session);
}
